package com.manage.common.util.dataFunction;

import java.text.DecimalFormat;
import java.util.Random;

public class CreateIdCard {
    //生成IdCard
    public static String getIdCard(){
        return start() + end();
    }

    //生成前三位
    public static String start(){
        String[] star = {"110", "130", "140", "150", "210", "220", "230", "310", "320", "330",
        "340", "350", "360", "370", "410", "420", "430", "440", "450", "460", "500", "510",
        "520", "530", "540", "610", "620", "630", "640", "650"};
        Integer num = new Random().nextInt(30);
        return star[num];
    }

    //生成剩下的手机号 15位
    public static String end(){
        double random = Math.random();
        DecimalFormat df = new DecimalFormat("0.000000000000000");
        String format = df.format(random).substring(2);
        return format;
    }
}
